#ifndef INTERFACES_H
#define INTERFACES_H

#include <string>
#include "shareheader.h"
#include "protocol.h"
#include <QObject>

class PlotObserver
{
    public:
        virtual void update() = 0;
		virtual ~PlotObserver() {}
};

class PlotObservable
{
    public:
        virtual void registerObserver(PlotObserver *observer) = 0;
        virtual void removeObserver(PlotObserver *observer) = 0;
        virtual void notifyObservers() = 0;
		virtual ~PlotObservable() {}
};

class ConfigObserver
{
    public:
        virtual void update() = 0;
		virtual ~ConfigObserver() {}
};

class ConfigObservable
{
    public:
        virtual void registerObserver(ConfigObserver *observer) = 0;
        virtual void removeObserver(ConfigObserver *observer) = 0;
        virtual void notifyObservers() = 0;
		virtual ~ConfigObservable() {}
};

class PlotControllerInterface
{
    public:
        virtual void addData(double x[], double y[]) = 0;
        virtual void addData(double x, double y, int curve) = 0;
        virtual void addCurve(std::string cur_name) = 0;
		virtual ~PlotControllerInterface() {}
};

class ConfigControllerInterface
{
    public:
        virtual void setTranSetting(int tranType, const TTranSetting& setting) = 0;
        virtual void setGenConfig(int genId, const TGenConfig& config) = 0;
        virtual TTranSetting getTranSetting(int tranType) = 0;
        virtual TGenConfig getGenConfig(int genId) = 0;
        virtual void setDuration(int duration) = 0;
        virtual int getDuration() = 0;
        virtual void setIncUser(int user) = 0;
        virtual int getIncUser() = 0;
        virtual void setIncTime(int sec) = 0;
        virtual int getIncTime() = 0;
        virtual void setUpdateRate(int rate) = 0;
        virtual int getUpdateRate() = 0;
        virtual void setServerIP(std::string ip) = 0;
        virtual std::string getServerIP() = 0;
        virtual void addGen(std::string ip="", int userCount = 0) = 0;
        virtual void delGen(int genId) = 0;
		virtual ~ConfigControllerInterface() {}
};

class RstatAgentInterface: public QObject
{
	Q_OBJECT

	public:
		virtual std::string getServerIP() = 0;
		virtual void setServerIP(std::string ip) = 0;
		virtual ~RstatAgentInterface() {}
	signals:
		void rstatDataArrived(TRstatData rstatData);
	public slots:
		virtual void InitAgent() = 0;
};

#endif // INTERFACES_H
